package cn.gcjxsc.repository.salesaman;

import cn.gcjxsc.consts.CheckStatus;
import cn.gcjxsc.entity.salesman.ApplyInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface ApplyInfoRepository extends JpaRepository<ApplyInfo, Integer>, JpaSpecificationExecutor<ApplyInfo> {

    long countByMemberId(Integer memberId);

    List<ApplyInfo> findByMemberIdAndStoreId(Integer memberId, Integer storeId);

    long countByMemberIdAndStatusAndStoreId(Integer memberId, CheckStatus status, Integer storeId);

    ApplyInfo findByMemberIdAndStoreIdAndStatus(Integer memberId, Integer storeId, CheckStatus status);
}
